<script type="application/xhtml+xml" id="dialog-form">
    <div class="container" style="margin-top: 0px;min-width: 500px;padding: 20px;">
    <$ if(!noForm){
            form  =form||{};
            $>
    <form class='form-horizontal dialog-form <$=form.class1 $>' id="dialog-form<$=form.id$>">
    <$}$>
    <$

    list[list.length-1].btn = list[list.length-1].btn||{};
    list.map(function(item){
    if(item.type=='text'||item.type=='password'){
    $>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7 $>">
            <input type="<$=item.type $>"
                   class="form-control <$=typeof item.validate != 'undefined'?item.validate:'' $> <$=typeof item.disabled != 'undefined'?(item.disabled?'disabled':''):'' $>"
                   name="<$=item.name $>"
                   placeholder="<$=item.placeholder $>"
                   value="<$= typeof item.val != 'undefined' ?item.val : '' $>"
            <$ if(typeof item['dataErrormessage']=='object'){
            Object.keys(item['dataErrormessage']).map(function(key){
            $>
            data-error-message-<$=key$>="<$=item['dataErrormessage'][key]$>"
            <$})}$>
            <$ if(typeof item['id']!='undefined'){
            $>
            id="<$=item.id$>"
            <$}$>
            />
        </div>
        <$ if(item.sendCode){ $>
        <div class="col-xs-<$=item.codeNum||5 $>">
            <a href="javascript:void(0)" class="btn btn-default code-btn <$=item.sendCode $>">获取验证码</a>
        </div>
        <$}$>
    </div>
    <$}else if(item.type=='textarea'){
    $>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7 $>">
            <textarea class="form-control <$=typeof item.validate != 'undefined'?item.validate:'' $> <$=typeof item.disabled != 'undefined'?(item.disabled?'disabled':''):'' $>"
                   name="<$=item.name $>"
                   placeholder="<$=item.placeholder $>"
            <$ if(typeof item['dataErrormessage']=='object'){
            Object.keys(item['dataErrormessage']).map(function(key){
            $>
            data-error-message-<$=key$>="<$=item['dataErrormessage'][key]$>"
            <$})}$>
            <$ if(typeof item['id']!='undefined'){
            $>
            id="<$=item.id$>"
            <$}$>
            ><$= typeof item.val != 'undefined' ?item.val : '' $></textarea>
        </div>
        <$ if(item.sendCode){ $>
        <div class="col-xs-<$=item.codeNum||5 $>">
            <a href="javascript:void(0)" class="btn btn-default code-btn <$=item.sendCode $>">获取验证码</a>
        </div>
        <$}$>
    </div>
    <$}else  if(item.type=='tags'){
    item.list.map(function(it,index1){ $>
    <span class="tag <$=item.validate $>" style="<$=(index1+1)%5==0?'margin-right:0':''$>"><$=it$></span>

    <$})
    $>
    <$}else  if(item.type=='avatar'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num?item.num:7 $>">
            <img class="<$=item.validate$>"
                 style="width:150px;height:150px;"
                 src="/imgs/login/avatar.png" alt="">
        </div>

    </div>
    <$}else if(item.type=='select'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-7">
            <select class="form-control"
                    name="<$=item.name $>"
                    placeholder="<$=item.placeholder $>"></select>
        </div>
    </div>
    <$}else if(item.type=='checkbox'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-<$=item.num||7 $>">
            <$ item.val.map(function(item1){$>
            <label class="checkbox-inline">
                <input  type="<$=item.type $>"
                        name="<$=item.name $>"
                        value="<$=item1.id $>" /> <$=item1.name $>
            </label>
            <$})$>
        </div>
    </div>
    <$}else if(item.type=='radio'){$>
    <div class="form-group">
        <label class="col-xs-<$=item.labelNum||3 $> control-label"><$=item.label $></label>
        <div class="col-xs-<$=item.num||7 $>">
            <$ item.val.map(function(item1){$>
            <label class="checkbox-inline">
                <input  type="<$=item.type $>"
                        name="<$=item.name $>"
                        value="<$=item1.val $>" /> <$=item1.name $>
            </label>
            <$})$>
        </div>
    </div>
    <$}else if(item.type=='remember'){ $>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-3 control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7 $>">
            <input type="checkbox"/> 自动登录
            <a class="fr" href="<$=item.url$>">忘记密码</a>
        </div>
    </div>
    <$} else if(item.type=='upload-btn'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <div><img src="<$=item.val||'/admin/imgs/upload/UPLOAD.png'$>" alt="" class="<$=item.previewClass $>"/></div>
            <div style="margin-top: 10px;" class="upload-select btn">选择上传</div>
        </div>
        <div class="hp-clearfix"></div>
    </div>
    <$}else if(item.type=='upload-dialog'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label" style="<$=item.labelStyle$>"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <%-include('../component/jcrop.html') %>
            <div   class="upload-select <$=item.btnClass $>">选择上传</div>
        </div>
    </div>
    <$}else if(item.type=='jcrop-dialog'){$>
    <div class="form-group">
    <$if(!item.noLabel){$>
    <label class="col-xs-<$=item.labelNum ||3$> control-label" style="<$=item.labelStyle$>"><$=item.label $></label>
    <$}$>
    <div class="col-xs-<$=item.num||7$>">
        <%-include('../component/jcrop.html') %>
    </div>
    </div>
    <$}else if(item.type=='editor'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <div  class="editor-content <$=item.editorClass $>" id="<$=item.editorId $>"></div>
        </div>
    </div>
    <$}else if(item.type=='codemirror'){$>
    <div class="form-group">
        <$if(!item.noLabel){$>
        <label class="col-xs-<$=item.labelNum ||3$> control-label"><$=item.label $></label>
        <$}$>
        <div class="col-xs-<$=item.num||7$>">
            <textarea  class="editor-content <$=item.editorClass $>" id="<$=item.editorId $>"></textarea>
        </div>
    </div>
    <$}})
    $>

    <$ if(!noForm){ $>
    <div class="form-group <$=typeof list[list.length-1].btn.ctner !='undefined'?list[list.length-1].btn.ctner:''$>">
        <div class="col-xs-<$=typeof list[list.length-1].btn.num !='undefined'?list[list.length-1].btn.num:'9 col-xs-offset-3'$>">
            <button type="submit" class="btn btn-primary <$=typeof list[list.length-1].btn.class_ !='undefined'?list[list.length-1].btn.class_:'' $>" name="submit" value="提 交"><$=typeof list[list.length-1].btn.label !='undefined'?list[list.length-1].btn.label:' 提 交 '$></button>
        </div>
        <$-typeof list[list.length-1].btn.html !='undefined'?list[list.length-1].btn.html:''$>

    </div>
    </form>
    <$}$>
 </div>
</script>
